/*
 * @Descripttion: 
 * @Author: sunchen
 * @Date: 2023-06-05 15:50:16
 * @LastEditors: sunchen
 * @LastEditTime: 2023-08-04 14:32:46
 */
import request from '@/utils/request';

const http = {
  /**
   * @description: get请求
   * @param {*}
   * @return {*}
   */
  get(
    url,
    params
  ){
    return request({
      url: `${url}`,
      method: 'get',
      params,
      ...params,
    });
  },
  /**
   * POST请求
   * @param {String} url - 接口地址
   */
  post(
    url,
    data
  ){
    return request({
      url: `${url}`,
      method: 'post',
      data,
    });
  },
  /**
   * put请求
   * @param {String} url - 接口地址
   */
  put(
    url,
    data
  ){
    return request({
      url: `${url}`,
      method: 'put',
      data,
    });
  },
  /**
   * @description: delete请求
   * @param {String} url
   * @return {*}
   */
  delete(
    url,
    data
  ){
    return request({
      url: `${url}`,
      method: 'delete',
      data,
    });
  },
   /**
   * @description: download请求
   * @param {*}
   * @return {*}
   */
   download(
    url,
    data
  ){
    return request({
      url: `${url}`,
      method: 'post',
      responseType: 'blob',
      data,
    });
  },
};

export default http;
